<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>v-if和v-show</title>
  <script type="text/javascript" src="vue.js"></script>
  <style>
    button {
      margin-top: 20px;
    }
  </style>
</head>
<body>
  <div id="app">
    <div v-show="loginByMobile">
      <label>手机号登录</label>
      <input type="text" placeholder="请输入手机号" key="by-mobile">
    </div>
    <div v-show="!loginByMobile">
      <label>邮箱登录</label>
      <input type="text" placeholder="请输入邮箱" key="by-email">
    </div>
    <button v-on:click="loginByMobile = !loginByMobile">更换登录方式</button>
  </div>

  <script>
    var vm = new Vue({
      el: '#app',
      data:{
        loginByMobile: true
      }
    })
  </script>
</body>
</html>